package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

class zbjw extends zcj {
   zbjw(zn var1, float var2, float var3, zbkq var4) {
      super(var1, var2, var3, var4);
   }

   com.aspose.cells.b.a.b.a.ze a(com.aspose.cells.b.a.b.zq var1) {
      com.aspose.cells.b.a.b.a.ze var2 = new com.aspose.cells.b.a.b.a.ze();
      float var3 = 0.0F;
      float var4 = 0.0F;
      com.aspose.cells.b.a.b.zo[] var5 = new com.aspose.cells.b.a.b.zo[7];
      float var6 = 1111.0F;
      float var7 = 26041.0F;
      ArrayList var8 = this.e.l.a;
      if (var8.size() > 0) {
         Iterator var9 = var8.iterator();

         while(var9.hasNext()) {
            zak var10 = (zak)var9.next();
            if (var10.b() == 327) {
               var6 = com.aspose.cells.b.a.ze.a((Object)var10.a());
            }

            if (var10.b() == 328) {
               var7 = com.aspose.cells.b.a.ze.a((Object)var10.a());
            }
         }

         var3 = Math.abs(var1.h() * (var6 / 21600.0F));
         var4 = Math.abs(var1.i() * (var7 / 21600.0F));
         if (var6 > 0.0F && var7 > 0.0F && var3 <= var1.h() && var4 <= var1.i()) {
            var2.b(var1);
            return var2;
         }
      } else {
         var6 = 1111.0F;
         var7 = 26041.0F;
         var3 = var1.h() * Math.abs(var6 / 21600.0F);
         var4 = var1.i() * Math.abs(var7 / 21600.0F);
      }

      float var13 = (float)(Math.atan((double)(var1.h() / var1.i())) * 180.0D / 3.141592653589793D);
      float var14 = 0.0F;
      if (var6 > 0.0F && var7 > 0.0F) {
         if (var3 < var1.h() / 2.0F && var4 > var1.i()) {
            var14 = 90.0F + (float)(Math.atan((double)((var1.h() / 2.0F - var3) / (var4 - var1.i() / 2.0F))) * 180.0D / 3.141592653589793D);
         } else if (var3 > var1.h() && var4 < var1.i() / 2.0F) {
            var14 = 360.0F - (float)(Math.atan((double)((var1.i() / 2.0F + var4) / (var3 - var1.h() / 2.0F))) * 180.0D / 3.141592653589793D);
         } else {
            var14 = (float)(Math.atan((double)(var4 / var3)) * 180.0D / 3.141592653589793D);
         }
      } else if (var6 < 0.0F && var7 > 0.0F) {
         if (var4 > var1.i() / 2.0F) {
            var14 = 90.0F + (float)(Math.atan((double)((var1.h() / 2.0F + var3) / (var4 - var1.i() / 2.0F))) * 180.0D / 3.141592653589793D);
         } else {
            var14 = 180.0F + (float)(Math.atan((double)((var1.i() / 2.0F - var4) / (var3 + var1.h() / 2.0F))) * 180.0D / 3.141592653589793D);
         }
      } else if (var6 < 0.0F && var7 < 0.0F) {
         var14 = 180.0F + (float)(Math.atan((double)((var1.i() / 2.0F + var4) / (var3 + var1.h() / 2.0F))) * 180.0D / 3.141592653589793D);
      } else if (var3 > var1.h() / 2.0F) {
         var14 = 360.0F - (float)(Math.atan((double)((var1.i() / 2.0F + var4) / (var3 - var1.h() / 2.0F))) * 180.0D / 3.141592653589793D);
      } else {
         var14 = 180.0F + (float)(Math.atan((double)((var1.i() / 2.0F + var4) / (var1.h() / 2.0F - var3))) * 180.0D / 3.141592653589793D);
      }

      if (var14 > 0.0F && var14 < 90.0F - var13) {
         var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g() + var4);
         var5[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g() + var1.i() * 0.83F);
         var5[2] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g() + var1.i());
         var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g() + var1.i());
         var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
         var5[5] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g());
         var5[6] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g() + var1.i() * 0.58F);
      } else if (var14 > 90.0F - var13 && var14 < 90.0F) {
         var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g() + var4);
         var5[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h() * 0.58F, var1.g() + var1.i());
         var5[2] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g() + var1.i());
         var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
         var5[4] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g());
         var5[5] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g() + var1.i());
         var5[6] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h() * 0.83F, var1.g() + var1.i());
      } else if (var14 > 90.0F && var14 < 90.0F + var13) {
         if (var6 < 0.0F) {
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var3 + 0.17F * var1.h() + var1.f(), var1.i() + var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
            var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.g());
            var5[5] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.i() + var1.g());
            var5[6] = new com.aspose.cells.b.a.b.zo(var3 + 0.42F * var1.h() + var1.f(), var1.i() + var1.g());
         } else {
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var4 + var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(0.17F * var1.h() + var1.f(), var1.i() + var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.i() + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var5[4] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var1.g());
            var5[5] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var1.i() + var1.g());
            var5[6] = new com.aspose.cells.b.a.b.zo(0.42F * var1.h() + var1.f(), var1.i() + var1.g());
         }
      } else if (var14 > 90.0F + var13 && var14 < 180.0F) {
         var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
         var5[1] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() * 0.58F + var1.g());
         var5[2] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
         var5[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.g());
         var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.g() + var1.i());
         var5[5] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() + var1.g());
         var5[6] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() * 0.83F + var1.g());
      } else if (var14 > 180.0F && var14 < 180.0F + (90.0F - var13)) {
         if (var7 < 0.0F) {
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() * 0.17F + var4 + var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var4 + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var4 + var1.g());
            var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.g() + var1.i() + var4);
            var5[5] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var4 + var1.i() + var1.g());
            var5[6] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() * 0.42F + var4 + var1.g());
         } else {
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() * 0.17F + var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.g());
            var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var1.g() + var1.i());
            var5[5] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() + var1.g());
            var5[6] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.i() * 0.42F + var1.g());
         }
      } else if (var14 > 180.0F + (90.0F - var13) && var14 < 270.0F) {
         if (var6 < 0.0F) {
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(var3 + 0.42F * var1.h() + var1.f(), var4 + var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var4 + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.h() + var1.f(), var4 + var1.i() + var1.g());
            var5[4] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g() + var1.i() + var4);
            var5[5] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var4 + var1.g());
            var5[6] = new com.aspose.cells.b.a.b.zo(var3 + 0.17F * var1.h() + var1.f(), var4 + var1.g());
         } else {
            var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g());
            var5[1] = new com.aspose.cells.b.a.b.zo(0.42F * var1.h() + var1.f(), var4 + var1.g());
            var5[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.g());
            var5[3] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.i() + var1.g());
            var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g() + var4 + var1.i());
            var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
            var5[6] = new com.aspose.cells.b.a.b.zo(var1.h() * 0.17F + var1.f(), var4 + var1.g());
         }
      } else {
         float var10000;
         if (var14 > 270.0F && var14 < 270.0F + var13) {
            if (var3 > var1.h()) {
               var10000 = var3 - var1.h();
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(0.83F * var1.h() + var1.f(), var4 + var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.i() + var1.g());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g() + var4 + var1.i());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
               var5[6] = new com.aspose.cells.b.a.b.zo(0.58F * var1.h() + var1.f(), var4 + var1.g());
            } else {
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(0.83F * var1.h() + var1.f(), var4 + var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.i() + var1.g());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g() + var4 + var1.i());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
               var5[6] = new com.aspose.cells.b.a.b.zo(0.58F * var1.h() + var1.f(), var4 + var1.g());
            }
         } else if (var14 > 270.0F + var13 && var14 < 360.0F) {
            if (var7 < 0.0F) {
               var10000 = var3 - var1.h();
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g());
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), 0.42F * var1.i() + var4 + var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.i() + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.i() + var1.g());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g() + var4);
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.g());
               var5[6] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var4 + var1.i() * 0.17F + var1.g());
            } else {
               var10000 = var3 - var1.h();
               var5[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g() + var4);
               var5[1] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), 0.42F * var1.i() + var1.g());
               var5[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var1.i() + var1.g());
               var5[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.i() + var1.g());
               var5[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
               var5[5] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var1.g());
               var5[6] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var1.i() * 0.17F + var1.g());
            }
         }
      }

      var2.a(var5[0], var5[1]);
      var2.a(var5[1], var5[2]);
      var2.a(var5[2], var5[3]);
      var2.a(var5[3], var5[4]);
      var2.a(var5[4], var5[5]);
      var2.a(var5[5], var5[6]);
      var2.a(var5[6], var5[0]);
      var2.i();
      return var2;
   }

   void b() {
      this.a.d();
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 1111.0F;
      float var4 = 26041.0F;
      ArrayList var5 = this.e.l.a;
      if (var5.size() > 0) {
         Iterator var6 = var5.iterator();

         while(var6.hasNext()) {
            zak var7 = (zak)var6.next();
            if (var7.b() == 327) {
               var3 = com.aspose.cells.b.a.ze.a((Object)var7.a());
            }

            if (var7.b() == 328) {
               var4 = com.aspose.cells.b.a.ze.a((Object)var7.a());
            }
         }

         var1 = Math.abs(this.e.f() * (var3 / 21600.0F));
         var2 = Math.abs(this.e.g() * (var4 / 21600.0F));
      } else {
         var3 = 1111.0F;
         var4 = 26041.0F;
         var1 = this.e.f() * Math.abs(var3 / 21600.0F);
         var2 = this.e.g() * Math.abs(var4 / 21600.0F);
      }

      float var11 = (float)(Math.atan((double)(this.e.f() / this.e.g())) * 180.0D / 3.141592653589793D);
      float var12 = 0.0F;
      if (var3 > 0.0F && var4 > 0.0F) {
         if (var1 < this.e.f() / 2.0F && var2 > this.e.g()) {
            var12 = 90.0F + (float)(Math.atan((double)((this.e.f() / 2.0F - var1) / (var2 - this.e.g() / 2.0F))) * 180.0D / 3.141592653589793D);
         } else if (var1 > this.e.f() && var2 < this.e.g() / 2.0F) {
            var12 = 360.0F - (float)(Math.atan((double)((this.e.g() / 2.0F + var2) / (var1 - this.e.f() / 2.0F))) * 180.0D / 3.141592653589793D);
         } else {
            var12 = (float)(Math.atan((double)(var2 / var1)) * 180.0D / 3.141592653589793D);
         }
      } else if (var3 < 0.0F && var4 > 0.0F) {
         if (var2 > this.e.g() / 2.0F) {
            var12 = 90.0F + (float)(Math.atan((double)((this.e.f() / 2.0F + var1) / (var2 - this.e.g() / 2.0F))) * 180.0D / 3.141592653589793D);
         } else {
            var12 = 180.0F + (float)(Math.atan((double)((this.e.g() / 2.0F - var2) / (var1 + this.e.f() / 2.0F))) * 180.0D / 3.141592653589793D);
         }
      } else if (var3 < 0.0F && var4 < 0.0F) {
         var12 = 180.0F + (float)(Math.atan((double)((this.e.g() / 2.0F + var2) / (var1 + this.e.f() / 2.0F))) * 180.0D / 3.141592653589793D);
      } else if (var1 > this.e.f() / 2.0F) {
         var12 = 360.0F - (float)(Math.atan((double)((this.e.g() / 2.0F + var2) / (var1 - this.e.f() / 2.0F))) * 180.0D / 3.141592653589793D);
      } else {
         var12 = 180.0F + (float)(Math.atan((double)((this.e.g() / 2.0F + var2) / (this.e.f() / 2.0F - var1))) * 180.0D / 3.141592653589793D);
      }

      com.aspose.cells.b.a.b.zq var8 = new com.aspose.cells.b.a.b.zq();
      if (var12 > 0.0F && var12 < 90.0F - var11) {
         var8 = this.e.k();
      } else if (var12 > 90.0F - var11 && var12 < 90.0F) {
         var8 = this.e.k();
      } else if (var12 > 90.0F && var12 < 90.0F + var11) {
         if (var3 < 0.0F) {
            var8 = new com.aspose.cells.b.a.b.zq(this.e.h() + var1, this.e.i(), this.e.k().h(), this.e.k().i());
         } else {
            var8 = this.e.k();
         }
      } else if (var12 > 90.0F + var11 && var12 < 180.0F) {
         var8 = new com.aspose.cells.b.a.b.zq(this.e.h() + var1, this.e.i(), this.e.k().h(), this.e.k().i());
      } else if (var12 > 180.0F && var12 < 180.0F + (90.0F - var11)) {
         if (var4 < 0.0F) {
            var8 = new com.aspose.cells.b.a.b.zq(this.e.h() + var1, this.e.i() + var2, this.e.k().h(), this.e.k().i());
         } else {
            var8 = new com.aspose.cells.b.a.b.zq(this.e.h() + var1, this.e.i(), this.e.k().h(), this.e.k().i());
         }
      } else if (var12 > 180.0F + (90.0F - var11) && var12 < 270.0F) {
         if (var3 < 0.0F) {
            var8 = new com.aspose.cells.b.a.b.zq(this.e.h() + var1, this.e.i() + var2, this.e.k().h(), this.e.k().i());
         } else {
            var8 = new com.aspose.cells.b.a.b.zq(this.e.h(), this.e.i() + var2, this.e.k().h(), this.e.k().i());
         }
      } else if (var12 > 270.0F && var12 < 270.0F + var11) {
         var8 = new com.aspose.cells.b.a.b.zq(this.e.h(), this.e.i() + var2, this.e.k().h(), this.e.k().i());
      } else if (var12 > 270.0F + var11 && var12 < 360.0F) {
         if (var4 < 0.0F) {
            var8 = new com.aspose.cells.b.a.b.zq(this.e.h(), this.e.i() + var2, this.e.k().h(), this.e.k().i());
         } else {
            var8 = this.e.k();
         }
      }

      if (!this.e.m().a()) {
         var8.a(-(this.e.m().f() / 2.0F), -(this.e.m().f() / 2.0F));
      }

      float var10 = zbul.a(this.e.n());
      if (this.e.p() != 7 && this.e.p() != 9) {
         if (this.e.p() == 0 || this.e.p() == 8) {
            var8.c(var8.h() - var10);
         }
      } else {
         var8.a(var8.f() + var10);
      }

      if (!this.e.t().equals("\n")) {
         zbul.a(this.a, this.e, var8, this.e.t(), this.e.s(), this.e.n(), this.e.o(), this.e.p(), this.e.q());
      }
   }
}
